package com.smile67.controller;


import com.smile67.common.restult.Result;
import com.smile67.pojo.entity.Monitor;
import com.smile67.service.IMonitorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author smile67
 * @since 2023-09-12
 */
@RestController
@RequestMapping("/monitors")
public class MonitorController {
    @Autowired
    private IMonitorService monitorService;
    /**
     * 查单个
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    public Result<Monitor> getById(@PathVariable Long id) {
        Monitor monitor = monitorService.getById(id);
        return Result.success(monitor);
    }

}
